import {http,PureHttp} from '@/utils/http'

interface ResponseType extends Promise<any> {
    data?: object;
    code?: number;
    message?: string;
}

/*
通过用户名获取用户id
*/
export const getTiDataList = (count: Number, id: string): ResponseType => http.request(
    'get',
    '/data/ti/list',
    {
        params: {
            count, id
        }
    }
)

/**
 * 分页查询中国地震台网地震事件
 * @param timeType
 * @param gradeType
 * @param page
 * @param size
 */
export const getCsnPage = (timeType: Number, gradeType: Number, page: Number, size: Number): ResponseType => http.request(
    'get',
    '/csn/page',
    {
        params: {
            timeType, gradeType, page, size
        }
    }
)

/*
上传帮助文档
*/

  export const uploadDoc = (params: any): ResponseType => PureHttp.axiosInstance.post(
    '/sys/user/uploadDoc',
    params, {headers: {'Content-Type': 'multipart/form-data'}}
  )